package com.cty;

import java.util.regex.Pattern;

public class regExpression08 {
    public static void main(String[] args) {
        //Pattern的matches()
        //作用：用于整体匹配，返回boolean类型
        String content = "hello hello jjdhz";
//        String regStr="hello";//返回结果：false
        String regStr = "hello.*";//true
        boolean matches = Pattern.matches(regStr, content);//用于判断规则和内容是否完全符合，是整体比较
        System.out.println("结果是" + matches);
    }
}

